Skip to content

Conversation

oliveror
Copy link
Member

Changes

  • Keyboard alternative to dragging (WCAG 2.2 SC 2.5.7 Dragging Movements, which our axe suite targets): every ingredient and step row has Move up / Move down buttons (Move ingredient 2 up, …), disabled at the first/last place. Drag-and-drop still works.
  • Focus is kept: after a move, focus stays on the moved row's button, or on its other move button when it reaches the first/last place, so pressing Enter repeatedly keeps moving the same row.
  • Announced: "Ingredient moved to position 2 of 3." in a polite live region.
  • Stable keys: rows now carry a stable key instead of the array index, so typed text and DOM state always move with their row. Instructions are { key, text } internally; the API payload is unchanged.
  • The test titled "button-based reordering" actually dragged the handle; it is renamed, and a real keyboard test was added.
  • On phones (≤ 40rem) the row buttons get their own line under the fields, so the fields keep their width (checked with screenshots at 375 px and 1280 px).
  • New ChevronUpIcon.

Validation

  • npm run check passes (212 unit tests), incl. the new keyboard test (disabled states, values follow rows, focus after each move incl. the edge case, announcements for ingredients and steps).
  • Real-database browser test (create/edit recipe) passes.

Notes

AI usage

Written with Claude Code (Anthropic) to address a teammate's review of the final-delivery findings. Please review the diff as you would any other contribution.

Closes #104

Rows could only be reordered by dragging (fails WCAG 2.2 SC 2.5.7) and
used array indexes as React keys, so DOM state could stay behind when
rows moved. Each row now has a stable key, and Move up / Move down
buttons that keep focus on the moved row (or its other button at the
first/last place) and announce the new position in a live region.
Drag-and-drop still works. On phones the row buttons move to their own
line under the fields. The test named 'button-based reordering' (which
actually dragged) is renamed and a keyboard test is added.

Closes #104
The test timed out on the CI runner (5056 ms of 5000 ms) because it typed
every field character by character. It now fills fields with
fireEvent.change and keeps real keyboard interaction for the moves it
tests; it runs in about 0.4 s locally.

Refs #104
@oliveror oliveror merged commit 00c4033 into dev Nov 17, 2026
2 checks passed
@oliveror oliveror deleted the fix/a11y-editor-reordering branch November 17, 2026 00:30
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants